Skip to content

Add debounced search with immediate clear and integration tests - #494

Merged
ritik4ever merged 1 commit into
ritik4ever:mainfrom
10xwhoman:test/debounced-search-unit
Jun 28, 2026
Merged

Add debounced search with immediate clear and integration tests#494
ritik4ever merged 1 commit into
ritik4ever:mainfrom
10xwhoman:test/debounced-search-unit

Conversation

@10xwhoman

Copy link
Copy Markdown
Contributor

Summary

  • CampaignsTable now calls onSearchChange('') synchronously when the user clears the search input, bypassing the 300 ms debounce delay
  • Regular typing still debounces normally via useDebounce(searchQuery, 300)
  • Adds CampaignsTable.debounce.test.tsx with 3 Vitest tests using fake timers:
    • API callback not fired before 300 ms elapses during typing
    • Callback fired exactly once after 300 ms pause (not on every keystroke)
    • Callback fired immediately on clear without timer advancement

Test plan

cd frontend && ./node_modules/.bin/vitest run src/components/CampaignsTable.debounce.test.tsx
# 3 passed

Closes #254

…ion tests

CampaignsTable now calls onSearchChange('') synchronously when the search
input is cleared, bypassing the 300ms debounce. Typing still debounces
normally via useDebounce. Adds Vitest tests that verify both behaviors
using fake timers.

Closes ritik4ever#254
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

@10xwhoman is attempting to deploy a commit to the ritik4ever's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@10xwhoman Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@10xwhoman, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 36 minutes and 32 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b942d661-51f2-42f3-a62a-f4b824701329

📥 Commits

Reviewing files that changed from the base of the PR and between 1beddc1 and fc7c839.

📒 Files selected for processing (2)
  • frontend/src/components/CampaignsTable.debounce.test.tsx
  • frontend/src/components/CampaignsTable.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ritik4ever
ritik4ever merged commit e984190 into ritik4ever:main Jun 28, 2026
2 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add debounced search input with 300ms delay

2 participants